#include<iostream>
#include <unistd.h>
#include <pthread.h>
#include <cstdio>
#include <cstring>

void* strat(void* arg)
{
    std::string name = static_cast<const char *>(arg);
    while (true)
    {
        std::cout << name << "我是一个新进程" << std::endl;
        sleep(1);
    }
    return 0;//退出
    //return (void*) 10;
    //pthread_exit((void*)10);
    //exit(1)://进程直接退出,也就是所有线程全部退出
}


int main()
{
    pthread_t prt;
    pthread_create(&prt,nullptr,strat,(void*)"thread-1");

    void* ret=nullptr;
    int n=pthread_join(prt,&ret);
    std::cout<<"n: "<<n<<std::endl;
    return 0;
}